package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.DingBundleUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author chenshan
 * @Since 2020-09-01 11:19
 */
@Repository
@Mapper
public interface DingBundleUserDao {
	Integer insert(DingBundleUserEntity dingBundleUserEntity);

	void insertBatch(List<DingBundleUserEntity> DingBundleUserList);

	Integer update(DingBundleUserEntity dingBundleUserEntity);

	Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

	DingBundleUserEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

	List<DingBundleUserEntity>	findEntitys(@Param("param") Map<String, Object> param);

	Integer getEntitysCount(@Param("param") Map<String, Object> param);

	Integer deleteByIdIn(@Param("idIn") List<Long> idIn, @Param("corpid") String corpid);
	
	Integer deleteByOpenConversationId(@Param("openConversationId") String OpenConversationId, @Param("corpid") String corpid);
	void updateBatch(@Param("list") List<DingBundleUserEntity> dingBundleUserList);
	
	void deleteByBundleAndUserIds(@Param("corpid") String corpid, @Param("bundleId") Long bundleId, @Param("list") List<String> list);
	
	void updateBatchSubAdmin(@Param("corpid") String corpid, @Param("openConversationId") String openConversationId, @Param("list") List<String> list);

	Integer dataConsistencyUpdateUser(@Param("corpid") String corpid, @Param("userId") String userId, @Param("name") String name, @Param("avatar") String avatar);
}